@import "../../../static/scss/variables";

.th-operation,
.btn-operation {
  text-align: center;
}

.panel-table {
  * + div.table-responsive {
    border-top: 1px solid #eaeff0;
  }
}

table.table-db {
  &:not(.table-break-title) thead tr th {
    white-space: nowrap;
  }

  &.table-fixed {
    table-layout: fixed;

    > thead > tr > th {
      white-space: normal;
    }

    > tbody > tr > td {
      white-space: normal;
      word-break: break-all;
    }
  }

  > tbody {
    > tr {
      border-top: 1px solid #eaeff0;

      > td {
        border-top: 0;
      }
    }
  }

  > thead, > tbody {
    > tr {
      .td-draggable {
        cursor: move;
      }

      .td-quick-editable {
        padding: 8px 20px 8px 15px;

        i.fa {
          float: right;
          cursor: pointer;
          opacity: 0;
          position: relative;
          z-index: 10;
        }

        &:hover i.fa {
          opacity: 1;
        }

        &:focus {
          position: relative;
          &:before {
            position: absolute;
            content: '';
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            z-index: 0;
            border: 1px dashed $brand-dark;
          }
        }
      }

      .th-sortable {
        padding-right: 23px;
        position: relative;
        .th-sort {
          float: none;
          position: absolute;
          right: 10px;
          width: 8px;
        }
      }
      .td-popover {

        i.fa {
          cursor: pointer;
          opacity: 0;
          display: inline-block;
          margin: 7px auto;
        }

        &:hover i.fa {
          opacity: 1;
        }
      }

      .th-searchable {
        padding-right: 30px;
        position: relative;
      }
      .th-searchable  i.fa {
        position: absolute;
        right: 10px;
        float: none;
        cursor: pointer;
        top: 11px;
        opacity: 0.2;
      }
      &:hover:not(.tr-odd):not(.tr-even) > th {
        &.th-searchable i.fa {
          opacity: 0.2;
        }

        &.th-searchable:hover i.fa {
          opacity: 1;
        }
      }

      &:hover:not(.tr-odd):not(.tr-even) > td {
        background-color: #f0f3f4;

        &.td-quick-editable i.fa {
          opacity: 0.2;
        }

        &.td-quick-editable:hover i.fa {
          opacity: 1;
        }
      }
    }

    > tr.tr-checked {
      // background: darken(#F5F5F5, 5%);
      background: lighten(#23b7e5, 40%);
      border-top: 1px solid lighten(#23b7e5, 30%);
      border-bottom: 1px solid lighten(#23b7e5, 30%);
      // color: #23b7e5;
      color: darken(#23b7e5, 20%);
    }

    > tr.tr-modified {
      background: #e8f0fe;
      border-top: 1px solid #e0e0e0;
      border-bottom: 1px solid #e0e0e0;
      color: #4285f4;
    }



    > tr.tr-dragging {
      > td {
        background: #f0f3f4;
        color: #f0f3f4;
      }
    }
  }
}

.table-dd-preview {
  margin-right: 40px;
  table tbody tr td {
    border-top-width: 1px;
    border-bottom-width: 1px;
  }
}

.panel.panel-table {
  .panel-heading {
    min-height: 40px;
    padding: 5px 15px;
    .col {
      vertical-align: middle;
    }
    .btn-group-col {
      width: 200px;
    }
  }
}

.panel.panel-unsaved, .panel-unsaved {
  .panel-heading {
    background-color: #e8f0fe;
    color: #4285f4;
  }
}

/*.form-quick-edit-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99;
}*/

.table-toolbar {
  margin-left: -5px;

  >.btn-group,
  >.btn,
  >.form,
  >div.inline {
    margin-left: 5px;
  }
}


.simple-popover {
  &.quick-edit-popover {
    min-width: 300px;
    box-shadow: none;
    padding: 0;
    border: 1px solid $border-color;

    .panel {
      //box-shadow: 0 2px 5px rgba(0,0,0,.2);
      margin: 0;
      border: 0;
      border-radius: 0;
    }
  }

  &.field-popover {
    min-width: 300px;
    max-width: 800px;
    padding: 0;
    border: 1px solid $border-color;
  }
}

.card-modified .panel {
  background: #e8f0fe;
  color: #4285f4;
  border-color: lighten(#4285f4, 20%);

  a {
    color: #4285f4;
  }
  .card-actions, .card-actions a {
    border-color: lighten(#4285f4, 20%);
  }
}

.card-highlight .panel {
  background: lighten(#FBDB4A, 30%);
  color: darken(#fbdc4c, 40%);
  border-color: lighten(#FBDB4A, 20%);

  a {
    color: darken(#fbdc4c, 40%);
  }
  .card-actions, .card-actions a {
    border-color: lighten(#FBDB4A, 20%);
  }
}